# Contributor:
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=ftgl
pkgver=2.4.0
pkgrel=4
pkgdesc="freetype OpenGL layer"
url="https://github.com/frankheckenbach/ftgl"
arch="all"
license="MIT"
depends_dev="mesa-dev freeglut-dev bash"
makedepends="$depends_dev freetype-dev autoconf automake libtool"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/frankheckenbach/ftgl/archive/v$pkgver.tar.gz
	gcc14.patch
	"
options="!check" # Missing cxxtest

prepare() {
	default_prepare
	./autogen.sh
}

build() {
	CXXFLAGS="$CXXFLAGS -flto=auto" \
	./configure \
		--prefix=/usr \
		--with-pic \
		--disable-static
	make
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dt "$pkgdir/usr/include/FTGL" -m644 src/FTSize.h
	install -Dt "$pkgdir/usr/include/FTGL" -m644 src/FTFace.h
}

sha512sums="
5a0d05dbb32952e5aa81d2537d604192ca19710cd57289ae056acc5e3ae6d403d7f0ffc8cf6c1aada6c3c23a8df4a8d0eabb81433036ade810bca1894fdfde54  ftgl-2.4.0.tar.gz
91078ebe17c79bb7059111c68080bf1769a2843c47de74733787c1e65c9efe2aa9f12457dcf57d154bb83d4cee0fbd9c7a45e894a315c0746dae090a5bdd84a5  gcc14.patch
"
